package klass.parse.domain.constant.factory;

import klass.parse.domain.constant.Constant;
import klass.parse.domain.constant.ConstantNameAndTypeInfo;

import java.io.InputStream;
import static klass.parse.util.InputStreamUtils.*;

public class ConstantNameAndTypeFactory extends BaseConstantFactory {
    @Override
    public Constant create(InputStream inputStream) {
        short nameIndex = nextShort(inputStream);
        short typeIndex = nextShort(inputStream);
        return new ConstantNameAndTypeInfo(nameIndex, typeIndex);
    }
}
